<!--$Id: repmgr_start.so,v 1.7 2007/09/21 20:06:04 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB: DB_ENV-&gt;repmgr_start</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td>
<b>DB_ENV-&gt;repmgr_start</b>
</td>
<td align=right>
<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
</tr></table>
<hr size=1 noshade>
<tt>
<b><pre>
#include &lt;db.h&gt;
<p>
int
DB_ENV-&gt;repmgr_start(DB_ENV *env, int nthreads, u_int32_t flags);
</pre></b>
<hr size=1 noshade>
<b>Description: DB_ENV-&gt;repmgr_start</b>
<p>The DB_ENV-&gt;repmgr_start method starts the replication manager.</p>
<p>There are two ways to build Berkeley DB replication applications: the most
common approach is to use the Berkeley DB library "replication manager"
support, where the Berkeley DB library manages the replication group,
including network transport, all replication message processing and
acknowledgment, and group elections.  Applications using the replication
manager support generally make the following calls:</p>
<ol>
<p><li>Call <a href="../api_c/repmgr_local_site.html">DB_ENV-&gt;repmgr_set_local_site</a> to configure the local site in the
replication group.
<p><li>Call <a href="../api_c/repmgr_remote_site.html">DB_ENV-&gt;repmgr_add_remote_site</a> to configure the remote site(s) in
the replication group.
<p><li>Call <a href="../api_c/repmgr_ack_policy.html">DB_ENV-&gt;repmgr_set_ack_policy</a> to configure the message
acknowledgment policy which provides the replication group's
transactional needs.
<p><li>Call <a href="../api_c/rep_priority.html">DB_ENV-&gt;rep_set_priority</a> to configure the local site's election
priority.
<p><li>Call DB_ENV-&gt;repmgr_start to start the replication application.
</ol>
<p>For more information on building replication manager applications,
please see the "Replication Manager Getting Started Guide" included in
the Berkeley DB documentation.</p>
<p>Applications with special needs (for example, applications using network
protocols not supported by the Berkeley DB replication manager), must perform
additional configuration and call other Berkeley DB replication methods.  For
more information on building advanced replication applications, please
see the "Advanced Replication Applications Guide" included in the Berkeley DB
documentation.</p>
<p>The DB_ENV-&gt;repmgr_start method may not be called before the <a href="../api_c/env_open.html">DB_ENV-&gt;open</a> method is called.</p>
<p>The DB_ENV-&gt;repmgr_start method
returns a non-zero error value on failure
and 0 on success.
</p>
<b>Parameters</b> <br>
 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to one of the following values:
<br>
<b><a name="DB_REP_MASTER">DB_REP_MASTER</a></b><ul compact><li>Start as a master site, and do not call for an election.  Note there
must never be more than a single master in any replication group, and
only one site at a time should ever be started with the
DB_REP_MASTER flag specified.</ul>
<b><a name="DB_REP_CLIENT">DB_REP_CLIENT</a></b><ul compact><li>Start as a client site, and do not call for an election.</ul>
<b><a name="DB_REP_ELECTION">DB_REP_ELECTION</a></b><ul compact><li>Start as a client, and call for an election if no master is found.</ul>
<br></ul>
 <b>nthreads</b><ul compact><li>Specify the number of threads of control created and dedicated to processing
replication messages.  In addition to these message processing threads,
the replication manager creates and manages a few of its own threads of
control.</ul>
<br>
<hr size=1 noshade>
<br><b>Class</b>
<a href="../api_c/env_class.html">DB_ENV</a>
<br><b>See Also</b>
<a href="../api_c/rep_list.html">Replication and Related Methods</a>
</tt>
<table width="100%"><tr><td><br></td><td align=right>
<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>
